//
//  QDNewsTableViewCell.m
//  QDMetroClient
//
//  Created by YueWen on 2019/2/14.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import "QDTextTableViewCell.h"

@implementation QDTextTableViewCell

@synthesize imageView = _imageView;

- (void)buildView {
    [super buildView];
    
    self.titleLabel = ({
        
        UILabel *label = [UILabel new];
        label.backgroundColor = [UIColor whiteColor];
        label.text = @"青岛地铁13号线通过试运营基本条件评审";
        label.font = RITLRegularFont(16);
        label.numberOfLines = 2;
        label.textColor = QDSColorDefaultSeparator;
        
        label;
    });
    
    self.subtitleLabel = ({
        
        UILabel *label = [UILabel new];
        label.backgroundColor = [UIColor whiteColor];
        label.text = @"青岛地铁  11-19  15:30";
        label.font = RITLRegularFont(12);
        label.textColor = RITLColorSimpleFromIntRBG(179);
        
        label;
    });
    
    self.imageView = ({
        
        UIImageView *imageView = [UIImageView new];
        imageView.backgroundColor = UIColor.whiteColor;
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.layer.cornerRadius = 4;
        imageView.layer.borderWidth = 0.5;
        imageView.layer.borderColor = RITLColorSimpleFromIntRBG(230).CGColor;
        imageView.clipsToBounds = true;
        
        imageView;
    });
    
    
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.subtitleLabel];
    [self.contentView addSubview:self.imageView];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(16);
        make.left.offset(20);
        make.height.mas_lessThanOrEqualTo(45);
        make.right.inset(136);
    }];
    
    [self.subtitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.bottom.inset(16.5);
        make.right.inset(136);
    }];
    
    
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(16);
        make.right.inset(20);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(68);
    }];
}


- (void)prepareForReuse {
    [super prepareForReuse];
    
    self.imageView.image = nil;
}


@end
